library("Hmisc")

x11(width = 6, height = 7)
pdf(width = 6, height = 7, file = "./method1_plots.pdf")
par(mfrow=c(2,2))
par(mar=c(2,2,2,2))

matrix_names <- c("graph_method1_n6_g0.050.csv", "graph_method1_n6_g0.100.csv", "graph_method1_n6_g0.250.csv", "graph_method1_n6_g0.350.csv")  
gammas <- c(0.05, 0.10, 0.25, 0.35)
for(index in 1:4) {
  matrix <- read.csv(matrix_names[index], header = FALSE)
  pattern <- t(matrix != 0)
  storage.mode(pattern) <- "integer"
  pairs <- which(pattern == 1, arr.ind = TRUE)
  p <- dim(pattern)[1]

  plot(pairs, col = "blue3", xlab = "", ylab = "", ylim = c(p,1),
      xlim = c(1,p), pch = 20, xaxt = 'n', yaxt = 'n' , cex = 2)
  axis(1)
  axis(2, las = "2")
  #axis(3, labels = "")
  #axis(4, labels = "")
  grid(col = "black")
  box(which = "plot", lty = "solid")
  title(bquote(gamma ~ " = " ~ .(gammas[index])), cex = 1.2)
}
dev.off()
